﻿function switchtab(ops)
{
	this.menus = ops.menus;
	this.cons = ops.cons;
	this.clsname = ops.clsname || "active";
	this.event = ops.event || "click";
	this.cur = ops.cur || 0;
	this.lbtn = ops.lbtn || null;
	this.rbtn = ops.rbtn || null;
	this.init();
}
switchtab.prototype = 
{
	init: function ()
	{
		var _this = this;
		this.menus.each(function (i)
		{
			$(this).on(_this.event, function ()
			{
				_this.cur = i;
				_this.change(_this.cur);
			});
		});
		if (this.lbtn)
		{
			this.lbtn.on("click", function ()
			{
				_this.cur--;
				if (_this.cur < 0)
				{
						_this.cur = _this.menus.length - 1;
				}
				_this.change(_this.cur);
			});
		}
		if (this.rbtn)
		{
			this.rbtn.on("click", function ()
			{
				_this.cur++;
				if (_this.cur >= _this.menus.length)
				{
						_this.cur = 0;
				}
				_this.change(_this.cur);
			});
		}
		this.change(this.cur);
	},
	change: function (i)
	{
		this.menus.removeClass(this.clsname).eq(i).addClass(this.clsname);
		this.cons.hide().eq(i).fadeIn();
	}
}
var uc =
{	
	query:function(type)
	{
			var url="";
			var s = $("#sdate").val();
			var e = $("#edate").val();
			if (s.length <= 0 && e.length <= 0)
					url = "/member/"+ type;
			else
					url = "/member/"+type+"?s=" + s + "&e=" + e;
			location.href = url;
	},
	quit:function(obj)
	{
		$(obj).html("请稍候...");
		var url = '/handle.php?module=member&action=exitlogin';		
		$.getJSON(url, null, function (data)
		{		
			if (data.statusCode == "200")
			{	
				setTimeout(function ()
				{
					location.href = data.url;
				}, 2000);
			}						
		})
	}
	     
}
